package top.kaoshanji.p1ch06a;

/**
 * 代码清单-p1ch06a-110页b：this关键字的简单使用
 * author kaoshanji
 * ^_^
 * create time 2025/3/8 15:57
 */
public class Leaf {

    int i = 0;
    Leaf increment() {
        i++;
        return this;
    }

    void print() {
        System.out.println("i = " + i);
    }

    public static void main(String[] args) {
        Leaf x = new Leaf();
        x.increment().increment().increment().print();

    }



}
